<template>
  <div class="header">
    <div class="page-title">用户管理</div>
      <!--<el-input
        placeholder="请输入微信名，按Enter键搜索..."
        suffix-icon="el-icon-search"
        v-model="searchContent"
        style="margin:20px 0 "
        @keyup.enter="search"
      >
      </el-input>-->
    
    <el-table :data="tableData" class="m-t-5" :key="num">
      <el-table-column type="selection" width="55"></el-table-column>
      <el-table-column prop="id" label="id" width="100"></el-table-column>
      <el-table-column
        prop="wxname"
        label="微信名"
        width="150"
      ></el-table-column>
      <el-table-column label="头像" width="200" class="t-c">
        <template #default="v">
          <el-image :src="v.row.wximage" fit="cover"></el-image>
        </template>
      </el-table-column>
      <el-table-column
        prop="price"
        label="余额"
        width="150"
      ></el-table-column>
      <el-table-column
        prop="create_time"
        label="注册时间"
        width="200"
      ></el-table-column>
    </el-table>
    
    <el-pagination
      background
      hide-on-single-page
      layout="prev, pager, next"
      :total="total"
      :current-page="current"
      @current-change="changePage"
    >
    </el-pagination>
  </div>
</template>
<script>

import { request_users } from "@/util/api";

export default {
  name: "SeekType",
  data() {
    return {
      current: 1,
      total: 0,
      form: {},
      num:1,
      searchContent: '',
      dialogFormVisible: false,
    };
  },
  computed: {},
  mounted() {
    this.init();
  },
  methods: {
    init() {
        this.changePage(1)
    },
    
    // 搜索
    search() {
      this.changePage(1);
    },
    // 分页
    changePage(page) {
      request_users({
        page,
        searchContent:this.searchContent
      })
        .then((res) => {
          const result = res.data;
          if (result.code == 200) {
            this.tableData = result.data.data;
            this.total = result.data.total;
            this.current = result.data.current;
            this.num = 13;
          }
        })
        .catch();
    },
  },
};
</script>

<style scoped  lang="less">
</style>